﻿@model IEnumerable<CREAPA.Dominio.OS>

@{
    ViewBag.Title = "Lista Completa de OS do Setor";
}

<h2>Lista Completa de OS do Setor</h2>



@{
    if (TempData["notice"] != null) {
    
        string msg = @TempData["notice"].ToString();
    
        <script type="text/javascript">

            alert('OS Gravada com sucesso');

    </script>
    }

    }

@{
    WebGrid grid = new WebGrid(source: Model, columnNames: new string[] { "Id", "Descricao", "DataCadOs", "PessoaCadastrou", "PessoaInteressado", "Problema", "Setor", "OrigemOS,TempoExec" }, canPage: true, rowsPerPage: 50);
}

@grid.GetHtml( tableStyle: "table",
        alternatingRowStyle: "alternate",
        headerStyle: "header",
        footerStyle: "footer",
        mode: WebGridPagerModes.FirstLast | WebGridPagerModes.NextPrevious,
        firstText: "Primeiro",
        previousText: "Anterior",
        nextText: "Próximo",
        lastText: "Último",columns: grid.Columns(
              grid.Column("Id", header: "Número", format: @<text><center>@item.Id</center></text>),
              grid.Column("Problema", header: "Problema", format: @<text>@item.Problema</text>),
              grid.Column("Descricao", header: "Descrição", format: @<text><div style='width: 15em'>@item.Descricao</div></text>),
              grid.Column("DataCadOs", header: "Data de Cadastro", format: @<text>@item.DataCadOs</text>),
              grid.Column("PessoaInteressado", header: "Interessado", format: @<text>@item.PessoaInteressado</text>),
              grid.Column("Setor", header: "Setor", format: @<text>@item.Setor</text>),
              grid.Column("Analisada", header: "Analisada", format: @<text><center><input name="Analisada" type="checkbox" value="@item.Analisada"@(item.Analisada == false ? null : "checked") disabled='disabled' /></center></text>),
              grid.Column("Encerrada", header: "Encerrada", format: @<text><center><input name="Encerrada" type="checkbox" value="@item.Encerrada"@(item.Encerrada == false ? null : "checked") disabled='disabled' /></center></text>),
              grid.Column("DescricaoAnalise", header: "Descrição Análise", format: @<text><center>@item.DescricaoAnalise</center></text>),
              grid.Column("TempoExec", header: "Tempo Exec", format: @<text><center>@item.TempoExec @item.TempoUnidade</center></text>),
           grid.Column("Encerrar", header: "Ver", format: @<text><center>@Html.ActionLink("Ver", "Detalhes", new { id = item.Id })</center></text>)	          
           )
)




